JS non-null & Optional Chaining

describe_the_problem

// 👇️ optional chaining (?.)
    inputRef.current?.focus();
// 👇️ using non-null (!) assertion
    inputRef.current!.focus();

Credits